import {
    http4
} from "@/service/axios";

// 角色列表
export function getRoleList(data) {
    return http4.get({
        url: '/user/role/list/page',
        params: data
    })
}

// 新增角色
export function getAddRole(data) {
    return http4.post({
        url: '/user/role/add',
        data
    })
}

// 编辑角色
export function getEditRole({
    id,
    data
}) {
    return http4.put({
        url: `/user/role/edit/${id}`,
        data
    })
}

// 角色状态编辑
export function getStatusAPi({
    id,
    status
}) {
    return http4.put({
        url: `/user/role/${status}/${id}`
    })
}

// 菜单列表（下拉框）接口 
export function getMenuTree() {
    return http4.get({
        url: '/user/menu/tree?onlyParent=1'
    })
}

export function roleMenuIdsApi(id) {
    return http4.get({
        url:`/user/role/menuIds/${id}`
    })
}

export function getMenusApi({id,data}) {
    return http4.put({
        url: `/user/role/menus/${id}`,
        data
    })
}